
function line(res, dom) {
	var myChart = echarts.init(document.getElementById(dom));
	var series = []
	res.datas.forEach((item, index) => {
		series.push({
			data: item.item,
			type: 'line',
			smooth: res.smooth,
			lineStyle: {
				color: item.color,
			},
			areaStyle: {
				color: item.acolor
			},
			symbol: res.symbol,
			itemStyle: {
				normal: {
					color: item.color
				}
			}
		})
	});
	option = {
		tooltip: {
			trigger: 'axis',
			axisPointer: { // 坐标轴指示器，坐标轴触发有效
				type: 'line' // 默认为直线，可选为：'line' | 'shadow'
			}
		},
		color: ['#159DF3', '#4CDCF0', '#62C625'],
		grid: {
			left: '3%',
			right: '3%',
			top: '20%',
			bottom: '5%',
			containLabel: true
		},
		yAxis: [{
			type: 'value',
			splitLine: {
				show: true,
				lineStyle: {
					color: 'rgba(78, 144, 242, 0.26)',
					type:'dashed'
				},
			},
			axisLabel: {
				interval: 0,
				formatter:function(params){
					return params+'kg'
				},
				textStyle: {
					color: '#fff', //坐标的字体颜色
					top: 20,
					lineHeight: 20,
					fontSize: 16
				}
			},
			axisLine: {
				show: true,
				lineStyle: {
					color: '#4E90F2',
					width: 1, //这里是坐标轴的宽度,可以去掉
				}
			}
		}],
		xAxis: {
			type: 'category',
			data: res.datax,			
			boundaryGap: true,
			axisLabel: {
				// interval: 0,				
				textStyle: {
					color: '#fff', //坐标的字体颜色
					lineHeight: 20,
					fontSize: 16
				}
			},
			splitLine: {
				show: false
			},
			axisLine: {
				show: true,
				lineStyle: {
					color: '#4E90F2',
					width: 1, //这里是坐标轴的宽度,可以去掉
				}
			}
		},
		series: series
	};
	myChart.clear(option);
	myChart.setOption(option);
	window.addEventListener("resize", function() {
		myChart.resize();
	});
}
